XMLElement xml;
String[] t_tag;
int[] t_count;
int v_convertit;

Fonte monTag_1;
Fonte monTag_2;
Fonte monTag_3;
Fonte monTag_4;
/*Fonte monTag_5;
Fonte monTag_6;
Fonte monTag_7;
Fonte monTag_8;
Fonte monTag_9;
Fonte monTag_10;
Fonte monTag_11;
Fonte monTag_12;
Fonte monTag_13;
Fonte monTag_14;
Fonte monTag_15;
Fonte monTag_16;
Fonte monTag_17;
Fonte monTag_18;
Fonte monTag_19;*/

void setup(){
  size(900, 600);

  xml = new XMLElement(this, "../tagmehdi.xml"); // appel du fichier XML
  int v_nbrPost = xml.getChildCount();
  t_tag = new String[0];
  t_count = new int[0];

  for (int i = 0; i < v_nbrPost; i++) {
    XMLElement v_post = xml.getChild(i); // Initialise un objet v_post qui correspond au i-eme enfant du noeud XML

    v_convertit =  int(v_post.getStringAttribute("count"));
    if(v_convertit > 7){
      t_tag = append(t_tag,v_post.getStringAttribute("tag"));
      t_count = append(t_count,v_convertit);
    }
  }
  
  monTag_1 = new Fonte(t_count[1],t_tag[1]);
  monTag_1.ecrit();
  monTag_2 = new Fonte(t_count[2],t_tag[2]);
  monTag_2.ecrit();
  monTag_3 = new Fonte(t_count[3],t_tag[3]);
  monTag_3.ecrit();
  /*monTag_4 = new Fonte(t_count[4],t_tag[4]);
  monTag_4.ecrit();
  monTag_5 = new Fonte(t_count[5],t_tag[5]);
  monTag_5.ecrit();
  monTag_6 = new Fonte(t_count[6],t_tag[6]);
  monTag_6.ecrit();
  monTag_7 = new Fonte(t_count[7],t_tag[7]);
  monTag_7.ecrit();
  monTag_8 = new Fonte(t_count[8],t_tag[8]);
  monTag_8.ecrit();
  monTag_9 = new Fonte(t_count[9],t_tag[9]);
  monTag_9.ecrit();
  monTag_10 = new Fonte(t_count[10],t_tag[10]);
  monTag_10.ecrit();
  monTag_11 = new Fonte(t_count[11],t_tag[11]);
  monTag_11.ecrit();
  monTag_12 = new Fonte(t_count[12],t_tag[12]);
  monTag_12.ecrit();
  monTag_13 = new Fonte(t_count[13],t_tag[13]);
  monTag_13.ecrit();
  monTag_14 = new Fonte(t_count[14],t_tag[14]);
  monTag_14.ecrit();
  monTag_15 = new Fonte(t_count[15],t_tag[15]);
  monTag_15.ecrit();
  monTag_16 = new Fonte(t_count[16],t_tag[16]);
  monTag_16.ecrit();
  monTag_17 = new Fonte(t_count[17],t_tag[17]);
  monTag_17.ecrit();
  monTag_18 = new Fonte(t_count[18],t_tag[18]);
  monTag_18.ecrit();
  monTag_19 = new Fonte(t_count[19],t_tag[19]);
  monTag_19.ecrit();*/

}

void draw(){
  background(171);
  monTag_1.bouge();
  monTag_2.bouge();
  monTag_3.bouge();
  /*monTag_4.bouge();
  monTag_6.bouge();
  monTag_7.bouge();
  monTag_8.bouge();
  monTag_9.bouge();
  monTag_10.bouge();
  monTag_11.bouge();
  monTag_12.bouge();
  monTag_13.bouge();
  monTag_14.bouge();
  monTag_15.bouge();
  monTag_16.bouge();
  monTag_17.bouge();
  monTag_18.bouge();
  monTag_19.bouge();*/
  
}
